import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: (res) => require(['@/components/Index'], res),
      meta: {
        title: '首页'
      },
      redirect: 'froms',
      children: [
        {
          path: '/froms',
          name: 'Froms',
          component: (res) => require(['@/components/pages/Froms'], res),
          meta: {
            title: '表单列表'
          }
        }
      ]
    },
    {
      path: '/fieldedit',
      name: 'FieldEdit',
      component: (res) => require(['@/components/pages/FieldEdit'], res),
      meta: {
        title: '表单编辑'
      }
    },
    {
      path: '/test',
      name: 'test',
      component: (res) => require(['@/components/pages/test'], res),
      meta: {
        title: '表单编辑'
      }
    }
  ]
})
